public class Java_0_1 {

    /**
     * == 和 equals的区别是什么
     *答：
     * ==使用的是引用比较
     * equals使用的是值比较
     */
    public static void main(String[] args) {
        String a = "张三";
        String b = "张三";
        String c = new String("张三");
        //引用比较
        System.out.println("a == b " + (a == b));
        System.out.println("a == c " + (a == c));
        System.out.println("b == c " + (b == c));
        //值比较
        System.out.println("a.equals(c) = " + a.equals(c));
    }
}
